<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ChemElement Importer</title>
<style>
	textarea
  {
    width: 100%;
    height: 15em;
  }
</style>
<script src="../../../kekule.js?min=false"></script>
  <!--
<script src="../../lan/classes.js"></script>
<script src="../../lan/xmlJsons.js"></script>
<script src="../../utils/kekule.utils.js"></script>
  -->
<script src="../kekule.dataUtils.js"></script>
<script src="../kekule.chemicalElementsData.js"></script>
<script src="../kekule.isotopesData.js"></script>
<script src="kekule.chemElemImporter.js"></script>

<script>
	var dest;
	function convert(withMass)
	{
		var data = document.getElementById('memoSrc').value;
		var options = withMass? {'calcNaturalMass': true}: null;
		dest = Kekule.ChemElemImporter.import(data, options);
		document.getElementById('memoResult').value = dest;
		return dest;
	}
</script>
</head>

<body>
<form id="formMain" name="formMain" method="post" action="">
  <fieldset>
    <legend>Source Data</legend>
    <label for="memoSrc"></label>
    <textarea name="memoSrc" id="memoSrc"></textarea>
  </fieldset>
  <fieldset>
    <legend>Converted</legend>
    <label for="memoResult"></label>
    <textarea name="memoResult" id="memoResult"></textarea>
    <div>
    	<input type="button" name="btnConvert" id="btnConvert" value="Convert" onclick="convert()" />
			<input type="button" name="btnConvertWithMass" id="btnConvertWithMass" value="Convert with Mass" onclick="convert(true)" />
    </div>
  </fieldset>
</form>
</body>
</html>
